:root {
    /* 基础色板 - 蓝紫色调 */
    --primary-dark: #2A2D43;
    --primary-accent: #5F6CAF;
    --primary-light: #A5A8D0;
    --primary-bg: #F8F9FF;
    --success: #4CAF82;
    --warning: #FFC107;

    /* 深色模式变量 */
    --dark-bg: #1A1C2B;
    --dark-text: #E0E0E0;
    --dark-accent: #7986CB;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-bg);
    color: var(--primary-dark);
}

[data-theme="dark"] body {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.navbar {
    background-color: var(--primary-dark);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .navbar {
    background-color: var(--dark-bg);
}


.navbar a {
    color: var(--primary-bg);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin: 0 4px;
}

.navbar a:hover {
    background-color: var(--primary-accent);
    transform: translateY(-1px);
}

.navbar .login {
    background-color: var(--primary-green);
}



.container {
    width: 95%;
    margin: 0 auto;
    padding: 24px;
    height: calc(100vh - 68px);
}



.code-container {
    display: flex;
    gap: 10px;
    height: calc(100% - 120px);
    position: relative;
    overflow: hidden;
}



.left-desc {
    flex: 0 0 50%;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: auto;
    transition: none;
    will-change: flex;
}

[data-theme="dark"] .left-desc {
    background-color: #252838;
    border-color: rgba(255, 255, 255, 0.1);
}



.left-desc pre {
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}



.right-code {
    flex: 0 0 50%;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    will-change: flex;
}

[data-theme="dark"] .right-code {
    background-color: #252838;
}

.ace_editor {
    border-radius: 8px;
    height: 100% !important;
}



.submit-section {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
    display: flex;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: none;
    z-index: 20;
    will-change: height;
}

.submit-resizer {
    width: 100%;
    height: 4px;
    background-color: transparent;
    cursor: row-resize;
    position: absolute;
    top: -2px;
    left: 0;
    z-index: 30;
    transition: background-color 0.2s;
    will-change: transform;
    touch-action: none;
}

.submit-resizer::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 4px;
    background-color: var(--primary-dark);
    border-radius: 2px;
    opacity: 0.5;
    transition: opacity 0.2s, width 0.2s;
}

.submit-resizer:hover::after,
.submit-section.resizing .submit-resizer::after {
    opacity: 0.8;
    width: 80px;
}

[data-theme="dark"] .submit-section {
    background-color: #252838;
    border-color: rgba(255, 255, 255, 0.1);
}




.result {
    flex: 1;
    padding: 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.03);
    min-height: 60px;
    color: var(--primary-dark);
}

[data-theme="dark"] .result {
    background: rgba(255, 255, 255, 0.05);
    color: var(--dark-text);
}



.btn-submit {
    background-color: var(--success);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}



.btn-submit:hover {
    background-color: #3D8B6F;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 130, 0.3);
}

.show-submit-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--success);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 1;
    pointer-events: auto;
}

.show-submit-btn:hover {
    background-color: #3D8B6F;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 130, 0.3);
}

.show-submit-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(10px);
}

[data-theme="dark"] .show-submit-btn {
    background-color: var(--dark-accent);
}

[data-theme="dark"] .show-submit-btn:hover {
    background-color: var(--primary-accent);
}

@media (max-width: 768px) {
    .code-container {
        flex-direction: column;
    }

    .submit-section {
        position: static;
        flex-direction: column;
        gap: 15px;
        margin-top: 20px;
    }

    .result {
        width: 100%;
    }

    .resizer {
        display: none !important;
    }
}

.resizer {
    width: 10px;
    height: 100%;
    background-color: var(--primary-dark);
    cursor: col-resize;
    opacity: 0.5;
    position: absolute;
    top: 0;
    z-index: 10;
    border-radius: 4px;
    will-change: transform;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.resizer:hover {
    opacity: 0.8;
}

body.resizing {
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
}

/* Markdown 内容样式 */
.markdown-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: var(--primary-dark);
    padding: 1rem;
}

.markdown-content code:not(pre code) {
    background-color: rgba(175, 184, 193, 0.2);
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
}

.markdown-content pre {
    background-color: #f6f8fa;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
    overflow: auto;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    font-size: 14px;
    line-height: 1.45;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
}

[data-theme="dark"] .markdown-content {
    color: var(--dark-text);
}

[data-theme="dark"] .markdown-content code:not(pre code) {
    background-color: rgba(110, 118, 129, 0.4);
}

[data-theme="dark"] .markdown-content pre {
    background-color: #161b22;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 2em;
    margin: 1em 0;
}

.markdown-content li {
    margin: 0.5em 0;
}

.markdown-content p {
    margin: 1em 0;
}

.markdown-content strong {
    font-weight: 600;
}

/* 代码高亮主题覆盖 */
.hljs {
    background: transparent !important;
    padding: 0 !important;
}

[data-theme="dark"] .hljs {
    color: #e6edf3;
}
